 import java.util.Arrays;
import java.util.Scanner;

public class Main1139 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n =sc.nextInt();
       int[] arr=new int[n];
        for (int i=1;i<=n;i++){
            int f=0;
            for (int j=2;j<=i-1;j++){
                if (i%j==0){
                    f++;
                    break;
                }
            }
            if (f==0 && i>1){
              arr[i]=i;
            }
        }
        Arrays.sort(arr);
        for (int i=1;i<n;i++){
            for (int j=i+1;j<n;j++){
                if (arr[i]!=0&&arr[j]-arr[i]==2){
                    System.out.println(arr[i]+" "+arr[j]);
                }
            }
        }
    }
}
